import java.util.HashMap;
import java.util.Map;

public class PaperSelection {
    private final Map<Paper, Student> selections = new HashMap<>();

    public PaperSelection() {
    }

    public boolean addSelection(Student student, Paper paper) {
        if (selections.containsKey(paper)) {
            return false;
        }
        selections.put(paper, student);
        return true;
    }

    public boolean isSelected(Paper paper) {
        return selections.containsKey(paper);
    }

    public Map<Paper, Student> getSelections() {
        return new HashMap<>(selections);
    }

    @Override
    public String toString() {
        return "PaperSelection{" +
                "selections=" + selections +
                '}';
    }
}    